package org.test.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.test.service.UserService;

@Controller
@RequestMapping("/user")
public class UserController {

	@Resource
	private UserService userService;

	@RequestMapping(method = RequestMethod.GET)
	public String showMasterList(HttpServletRequest request) {
		request.setAttribute("users", userService.findAll());
		return "/index.jsp";
	}
	
	
	@RequestMapping(value = "/slave",method = RequestMethod.GET)
	public String showSalveList(HttpServletRequest request) {
		request.setAttribute("users", userService.findSlaveAll());
		return "/index.jsp";
	}
	
}
